# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        潘炎珍  
# Name:         test04
# Description:
# Author:       98745
# Date:         2019/4/9
#-------------------------------------------------------------------------------

from bs4 import *
import re
html = '''
<html>
    <head><title>html5lib测试</title></head>
    <body>
       <p>广州 天河区 车陂<em class="vline"></em>经验不限<em class="vline"></em>大专</p>
       <p>广州 天河区 珠江新城<em class="vline"></em>1-3年<em class="vline"></em>本科</p>
    </body>
</html>
'''

soup=BeautifulSoup(html,'lxml')
# print(soup.body.p.text)
data=soup.body.p.text
ex='经验不限|1年以内|\d\-\d年'
ed='学历不限|大专|本科|硕士|博士'
# s="经验不限"
try:
    experience=re.search(ex,data).group()
    print(experience)
    n=data.find(experience)
    place=data[0:n]
    print(place)
    education=re.search(ed,data).group()
    print(education)


    # print(data.find(m.group()))
except Exception as e:
    print(e)

